<?php
/* @var $this SiteController */
/* @var $model ContactForm */
/* @var $form CActiveForm */

$this->pageTitle=Yii::app()->name . ' - Contact Us';
$this->breadcrumbs=array(
	'Contact',
);
?>
<div class="panel panel-primary">
  <!-- Default panel contents -->
  <div class="panel-heading">Contact Us</div>
  <div class="panel-body">


<?php if(Yii::app()->user->hasFlash('contact')): ?>

<div class="flash-success">
	<?php echo Yii::app()->user->getFlash('contact'); ?>
</div>

<?php else: ?>

<p>
If you have business inquiries or other questions, please fill out the following form to contact us. Thank you.
</p>


<div class="form form-horizontal">  

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'contact-form',
	'enableClientValidation'=>true,
	'clientOptions'=>array(
		'validateOnSubmit'=>true,
	),
));


?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="form-group">
		<?php echo $form->labelEx($model,'name', array('class'=>'col-md-2 control-label')); ?>		
		<div class="col-md-10">
        <?php echo $form->textField($model,'name',array('class'=>'form-control')); ?>		
        </div>
        <?php echo $form->error($model,'name'); ?>
	</div>

	<div class="form-group">
		<?php echo $form->labelEx($model,'email', array('class'=>'col-md-2 control-label')); ?>
		<div class="col-md-10">
		<?php echo $form->textField($model,'email', array('class'=>'form-control')); ?>
		</div>
		<?php echo $form->error($model,'email'); ?>
	</div>

	<div class="form-group">
		<?php echo $form->labelEx($model,'subject', array('class'=>'col-md-2 control-label')); ?>
		<div class="col-md-10">
		<?php echo $form->textField($model,'subject',array('size'=>60,'maxlength'=>128, 'class'=>'form-control')); ?>
		</div>
		<?php echo $form->error($model,'subject'); ?>
	</div>

	<div class="form-group">
		<?php echo $form->labelEx($model,'body', array('class'=>'col-md-2 control-label')); ?>
		<div class="col-md-10">
        		<?php
				$this->widget('ext.ckeditor.widgets.ExtEditMe', array(
    'name'=>'ContactForm[body]',
    'value'=>$model->body,
	'filebrowserImageBrowseUrl'=>Yii::app()->createUrl('elfinder/show'),
	//'ckeConfig'=>array()
));
				
				//echo $form->textArea($model,'p',array('rows'=>6, 'cols'=>50, 'class'=>'form-control')); ?>
		</div>
		<?php echo $form->error($model,'body'); ?>
	</div>

	<?php if(CCaptcha::checkRequirements()): ?>
	<div class="form-group">
		<?php echo $form->labelEx($model,'verifyCode',array('class'=>'col-md-2 control-label')); ?>
		<div class="col-md-10">
        <?php echo $form->textField($model,'verifyCode'); ?>
		<?php $this->widget('CCaptcha'); ?>
        <div class="hint">Please enter the letters as they are shown in the image above.
		<br/>Letters are not case-sensitive.</div>
        <?php echo $form->error($model,'verifyCode'); ?>
		</div>
        
		</div>
		
        <?php
		
		$this->widget('ext.elFinder.ServerFileInput', array(
        'model' => $model,
        'attribute' => 'uploadFile',
        'connectorRoute' => 'elfinder/connector',
        )
);
		
		?>
		
	</div>
	<?php endif; ?>
</div></div>
<div class="panel-footer" align="center">
	<div class="row buttons">
	
		<?php echo CHtml::submitButton('Submit'); ?>
	</div>
</div>
<?php $this->endWidget(); ?>

</div><!-- form -->

<?php endif; ?>